/**
 * 
 */
package org.bankabeule.util;

import org.bankabeule.provider.BankabeuleItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.ILabelProvider;

/**
 * @author sdudoit
 *
 */
public class Providers {

	
	/**
	 * Constructor
	 */
	private Providers() {
	}
	
	
	/**
	 * Get adapter factory
	 */
	public static ComposedAdapterFactory getAdapterFactory() {
		ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
				ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
		adapterFactory
				.addAdapterFactory(new BankabeuleItemProviderAdapterFactory());
		adapterFactory
				.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
		return adapterFactory;
	}
	
	
	/**
	 * Get content provider
	 */
	public static IContentProvider getContentProvider() {
		return new AdapterFactoryContentProvider(getAdapterFactory());
	}
	
	
	/**
	 * Get label provider
	 */
	public static ILabelProvider getLabelProvider() {
		return new AdapterFactoryLabelProvider(getAdapterFactory());
	}	
	
	
}
